Q: Which of the following uses structure?
Solution: The structure is a user-defined data type in C language which allows us to combine data of different types together. Structure helps to construct a complex data type that is more meaningful. It is somewhat similar to an Array, but an array holds data of similar type only. But the structure, on the other hand, can store data of any type, which is practical more useful. The correct answer is: All of these
Q: How many specifiers are present in access specifiers in class? (c++)
Solution: In C++, there are three access specifiers: public - members are accessible from outside the class. private - members cannot be accessed from outside the class. protected - members cannot be accessed from outside the class, however, they can be accessed in inherited classes. The correct answer is:3
Q: John wants to go to different locations of the city in which he is. He has listed all of them down. However, he wants to visit one location before visiting some other location What application of graphs he uses to determine that location?
Solution: Topological sorting for Directed Acyclic Graph (DAG) is a linear ordering of vertices such that for every directed edge u v, vertex u comes before v in the ordering. The correct answer is: Topological Sorting
Q: What is an array?
Solution: An array is a data structure that contains a group of elements. Typically these elements are all of the same data type, such as an integer or string. Arrays are commonly used in computer programs to organize data so that a related set of values can be easily sorted or searched. The correct answer is: An array is a series of elements of the same type in contiguous memory locations.
Q: An expression involving byte, int, and literal numbers is promoted to which of these?
Solution: It will be converted to int before any calculation is done. The correct answer is: int
Q: A pointer variable can be
Solution: A pointer is a variable that stores the address of another variable. For example, an integer variable stores an integer value, however, an integer pointer holds the address of an integer variable. The correct answer is: Passed to a function as argument.
Q: What is the output of this program? #include < stdio.h > #include < string.h > #include < stdlib.h > void myfunc(char** param) { ++param;} int main(){ char* string = (char*)malloc(64); strcpy(string. "hello_world"); myfunc(&string); myfunc(&string); printf("&s ", string); //ignore memory leak for sake of quiz return 0;
Solution: The correct answer is: hello_World
Q: What is the output of this program? #include < stdio.h > using namespace std; int main() { char str[5] = "ABC"; cout << str[3]; cout <
Solution: The correct answer is: ABC
Q: What is the output of this program? #include < stdio.h > void main() { int k = 5; int *p =&k; int **m = &p; printf("&d&d&d ", k, *p, **p); }
Solution: It is a Compile time error. Compile-Time Errors: Errors that occur when you violate the rules of writing syntax are known as Compile-Time errors. The correct answer is: Compile time error
You Have Score    | /9 |